def add_two_sum(lis, target):
     '''从序列中选出两个数之和等于target, 返回两个数的索引位置
     不允许返回重复的索引
     '''
     dic = dict()
     for i in range(len(lis)):
          other = target - lis[i]
          if (other in dic):
               return (dic[other], i)
          else:
               dic[lis[i]] = i



print(add_two_sum([3, 2, 4], 6))
